<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head th:include="common_include :: commonHead('仓库编辑')"/>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form class="form-horizontal m" id="form-repository-edit" th:object="${repository}">
                <input type="hidden" name="rowKey" id="rowKey" th:field="*{rowKey}"/>
                <input type="hidden" name="serverKey" id="serverKey" th:field="*{serverKey}"/>
                <div class="form-group">
                    <label class="col-sm-3 control-label">仓库名称：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="repositoryName" id="repositoryName" readonly="true" th:field="*{repositoryName}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">仓库类型：</label>
                    <div class="col-sm-8">
                        <select id="repositoryType" name="repositoryType" class="form-control m-b"
                                th:with="dicts=${@dictCode.selectDictCodeByType('svnkit_repository_type')}" th:field="*{repositoryType}">
                            <option th:each="dict:${dicts}" th:text="${dict['codeText']}"
                                    th:value="${dict['codeValue']}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">仓库描述：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="repositoryDesc" id="repositoryDesc" th:field="*{repositoryDesc}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">联系人：</label>
                    <div class="col-sm-8 picker">
                        <input class="form-control" type="text" name="contactsPerson" id="contactsPerson" th:field="*{contactsPerson}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">联系人邮箱：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="email" name="contactsEmail" id="contactsEmail" th:field="*{contactsEmail}"/>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="common_include :: commonFoot"/>
<script type="text/javascript">
    var prefix = ctx + "service/svnkit/repositories"

    $("#form-repository-edit").validate({
        submitHandler: function (form) {
            $.operate.save(prefix + "/edit", $('#form-repository-edit').serialize());
        }
    });

    function submitClick() {
        if ($('#form-repository-edit').valid()) {
            $('#form-repository-edit').submit()
        }
    }
</script>
</body>
</html>
